import 'package:flutter/material.dart';

import '../widget/vc_widget.dart';
import 'base_color_utils.dart';
import 'base_sys_utils.dart';

class BaseViewUtils {
  static Widget noData(
      {String? src,
        String? msg = 'No Data',
        EdgeInsets? margin,
        Color? msgColor,
        double? msgSize,
        double? width,
        double? height,
        double? marginImageTop = 0}) {
    return Container(
      alignment: Alignment.topCenter,
      margin: margin ?? const EdgeInsets.only(top: 60),
      child: Column(
        // alignment: Alignment.center,
        children: <Widget>[
          ImageView(
            src: BaseSysUtils.empty(src)
                ? source('images/no_data')
                : source(src!),
            margin: EdgeInsets.only(bottom: marginImageTop ?? 0),
            width: width ?? 120,
            height: height ?? 120,
            fit: BoxFit.fitWidth,
          ),
          TextView(
            msg ?? '',
            size: msgSize ?? 13,
            margin: const EdgeInsets.only(top: 4),
            color: msgColor ?? ColorUtils.line,
          )
        ],
      ),
    );
  }
}